package com.bwie.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.mapper.TbBrandMapper;
import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class TbBrandServiceImpl extends ServiceImpl<TbBrandMapper, TbBrand> implements TbBrandService {
    @Autowired
    TbBrandMapper tbBrandMapper;
    @Override
    public R getBrandList() {
        List<TbBrand> tbBrands = tbBrandMapper.selectList(null);
        return R.OK(tbBrands);
    }

    @Override
    public R getBrandById(Integer brandId) {
        System.out.println("郭祥真的太帅了,小弟膜拜膜拜你");
        TbBrand tbBrand = tbBrandMapper.selectById(brandId);
        return R.OK(tbBrand);
    }
}
